package com.shopping.serviceImpl;

import com.shopping.dao.CollectDao;
import com.shopping.pojo.vo.ProductCollectInfo;
import com.shopping.pojo.vo.ProductInfo;
import com.shopping.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl implements CollectService {
    @Autowired
    private CollectDao collectDao;
    @Override
    public boolean insertCollect(Integer userId, Integer productId) {
        return collectDao.insertCollect(userId,productId)>0;
    }

    @Override
    public boolean deleteCollect(Integer id) {
        return collectDao.deleteCollect(id)>0;
    }

    @Override
    public boolean isCollect(Integer userId, Integer productId) {
        return collectDao.isCollect(userId,productId)>0;
    }

    @Override
    public List<ProductCollectInfo> selectCollectProductByUserNameAndProductName(String userName, String productName) {
        return collectDao.selectCollectProductByUserNameAndProductName(userName,productName);
    }


}
